import {createRouter, createWebHistory} from "vue-router";

let routes = [
    {
        path: "/",
        redirect: '/login',
    },
    {
        path: "/login",
        name: "login",
        component: () => import('@/components/views/login/index.vue')
    },
    {
        path: "/home",
        name: "home",
        component: () => import('@/components/views/home/Home.vue'),
        children: [
            {
                name: 'home-index',
                path: 'index',
                component: () => import('@/components/views/home/mian/index/Index.vue'),
            },
            {
                name: 'data-screen',
                path: 'data-screen',
                component: () => import('@/components/views/home/mian/DataScreen/DataScreen.vue'),
            },
        ],
    },
    {
        path: "/404",
        name: "404",
        component: () => import('@/components/views/404/index.vue')
    },
    {
        path: "/:catchAll(.*)",
        name: "Any",
        redirect: "/404"
    }
]
// 路由
const router = createRouter({
    history: createWebHistory(),
    routes,
    scrollBehavior() {
        return {
            left: 0,
            top: 0
        }
    },
})
// 导出
export default router
